{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e5ff5dbf",
   "metadata": {},
   "source": [
    "# 回顾知识--2022-09-13\n",
    "* range范围"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c6da7e7f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "range(0, 5)"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "range(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ee7cd26d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "1\n",
      "2\n",
      "3\n",
      "4\n"
     ]
    }
   ],
   "source": [
    "for i in range(5):\n",
    "    print(i) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "bf5f981b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# for+range=循环次数\n",
    "# start stop step？\n",
    "# 由数字0开始，持续范围里的出现的数字个数=（5-1） 大减小"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "3533c5e9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "4\n",
      "7\n"
     ]
    }
   ],
   "source": [
    "for i in range(1, 10, 3):\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "bcccaa3e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 从数字1开始，与下一个数字隔着3 步长（+3），在10之前停下"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6ae13b5",
   "metadata": {},
   "source": [
    "# 学习新知识--2022-09-13\n",
    "# 记录者：张钰华\n",
    "* 数值 and 字符串\n",
    "* 1.整数int\n",
    "* 2.小数float浮点型\n",
    "* 3.复数complex(虚数，复数)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "69bed45d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9 <class 'int'>\n"
     ]
    }
   ],
   "source": [
    "## Number(数值)\n",
    "a = 9\n",
    "print(a,type(a))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5a982304",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3.14 <class 'float'>\n"
     ]
    }
   ],
   "source": [
    "b = 3.14\n",
    "print(b,type(b))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "6c0e0b7c",
   "metadata": {},
   "outputs": [],
   "source": [
    "## type(数值类型)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "e1f0cba0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(5+3j) <class 'complex'>\n"
     ]
    }
   ],
   "source": [
    "c = 5 + 3j\n",
    "print(c,type(c))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "9e59a19f",
   "metadata": {},
   "outputs": [],
   "source": [
    "## String(字符串)\n",
    "## 一定要加引号（单，双，三）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "f81b7b0a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "eggs <class 'str'>\n"
     ]
    }
   ],
   "source": [
    "f = \"eggs\"\n",
    "print(f,type(f))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "ed1a809b",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 要用完整一致的引号形式\n",
    "##  只能用‘”“’或者”‘’“ 即前后的符号要一致，不能乱串，例如不能出现‘“’”结果会报错\n",
    "## 或者用斜杠符号会出现你想要表达的符号，但会报错形式的符号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "8539e795",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"doesn't\""
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"doesn\\'t\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "6da9ea65",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"don't\""
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"don\\'t\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "79e035ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5.666666666666667"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "17 / 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "44a801c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "17 // 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "b8a5878f",
   "metadata": {},
   "outputs": [],
   "source": [
    "#  符号//取商的意思"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "d2ea8a9b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "17 % 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "9ed160c9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 符号%是取余的意思"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "b9c11bbe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "5 * 3 + 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "8c19e98a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 符号* 为乘号"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "4fda3c9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "25"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "5 ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "fc5a47b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "78125"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "5 ** 7\n",
    "# 5的七次方"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "01562c26",
   "metadata": {},
   "source": [
    "# 有序字符串\n",
    "* 1.index--i(缩影)：由0开始\n",
    "* 2.title 切片[ 0:6 ]\n",
    "* 3.enumerate()列举了文本及缩影\n",
    "* 4.in 可以检查文本中的成员对象\n",
    "# 拼接\n",
    "* 1.capitalize()是首字母大写化\n",
    "* 2.count()可以明确文本出现的次数\n",
    "* 3.split()可将文本分割成两部分，以某元素为界"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "dc8b074c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "广州南方学院坐落于广州市从化温泉镇\n"
     ]
    }
   ],
   "source": [
    "# 关于有序性\n",
    "title = \"广州南方学院坐落于广州市从化温泉镇\"\n",
    "print(title)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "ea4e38fa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广'"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title[0] # 取单一值,取文本从左到右的值由0开始，# index为缩影值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "fa5509d6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'州'"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title[1] #取单一值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "b06d9b71",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'南'"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "38549eaf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'镇'"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title[-1] # 取文本从由右往左的值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "3c0772dc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广州南方学院'"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title[0:6] # 取一定范围的值，这种方法称之为切片（即从0开始前切，到想要的数字后再切）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "b76b6a72",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(title) # 取文本的总长度length"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "6b8f86af",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'广州南方学院'"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title[ :6]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "ce1e672a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "广\n",
      "州\n",
      "南\n",
      "方\n",
      "学\n",
      "院\n",
      "坐\n",
      "落\n",
      "于\n",
      "广\n",
      "州\n",
      "市\n",
      "从\n",
      "化\n",
      "温\n",
      "泉\n",
      "镇\n"
     ]
    }
   ],
   "source": [
    "# 利用for循环，遍历文本信息\n",
    "for i in title:\n",
    "    print(i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "456a72f7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 广\n",
      "1 州\n",
      "2 南\n",
      "3 方\n",
      "4 学\n",
      "5 院\n",
      "6 坐\n",
      "7 落\n",
      "8 于\n",
      "9 广\n",
      "10 州\n",
      "11 市\n",
      "12 从\n",
      "13 化\n",
      "14 温\n",
      "15 泉\n",
      "16 镇\n"
     ]
    }
   ],
   "source": [
    "# 思考如何判断文本中是否存在“广州”---广/州\n",
    "# enumerate 枚举，列举的意思\n",
    "for i,j in enumerate(title):\n",
    "    print(i,j)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "07abbef5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "广州这个词在这段文本中\n",
      "广州这个词在这段文本中\n"
     ]
    }
   ],
   "source": [
    "for i,j in enumerate(title):\n",
    "    if j == \"广\":\n",
    "        if title[i+1] == \"州\":\n",
    "            print(\"广州这个词在这段文本中\")\n",
    "    \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "0a1c13da",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"广州\" in title\n",
    "## in 检查成员对象"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "7ae0e9d9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"美丽的\" in title\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "44177f0d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'helloyura'"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 字符串的拼接\n",
    "\"hello\"+\"yura\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "id": "63bedaa7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "helloyura\n"
     ]
    }
   ],
   "source": [
    "print(\"hello\"+ \"yura\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "eb9ccad0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "你好，世界\n"
     ]
    }
   ],
   "source": [
    "print(\"你好，世界\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "id": "f44e58df",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "你好,世界\n"
     ]
    }
   ],
   "source": [
    "print(\"你好\"+\",\"+\"世界\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "9029564f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 字符串不可以和数值一起连接\n",
    "# 字符串不可以用来运算\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "id": "0cac93d0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "print(1)\n",
    "print(\"1\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "id": "fb30b965",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 <class 'int'>\n",
      "1 <class 'str'>\n"
     ]
    }
   ],
   "source": [
    "print(1,type(1))\n",
    "print(1,type(\"1\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "7650745e",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "unsupported operand type(s) for /: 'str' and 'str'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[1;32mIn [87]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m3\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m8\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\n",
      "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for /: 'str' and 'str'"
     ]
    }
   ],
   "source": [
    "\"3\"/\"8\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "b55ee38c",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "can only concatenate str (not \"float\") to str",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[1;32mIn [86]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m3\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1.2\u001b[39;49m\n",
      "\u001b[1;31mTypeError\u001b[0m: can only concatenate str (not \"float\") to str"
     ]
    }
   ],
   "source": [
    "\"3\"+ 1.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "id": "9524e131",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 字符串的方法\n",
    "# count\n",
    "# split\n",
    "# capitalize\n",
    "name = \"marry\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "68c4b3ad",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Marry'"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name.capitalize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "2292d240",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "name.count(\"r\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "ed231394",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title.count(\"广州\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "e8fc41e9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "title.count(\"新媒体\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "96dad99a",
   "metadata": {},
   "outputs": [],
   "source": [
    "letter = \"love me\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "id": "72ba90c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Love me'"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "letter.capitalize()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "id": "8af563c0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "letter.count(\"e\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "43771eb4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "letter.count(\"x\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "e0d3c0e9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# count()可以统计文本词出现数量；是数量词的意思\n",
    "# capitalize()可以将文本英文第一个字母变大写；；是首要化的意思"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "075ba76a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['广州南方学院', '广州市从化温泉镇']"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## split()可将文本按左右分隔开两部分;是分割的意思\n",
    "title.split(\"坐落于\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "id": "05260e95",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['lo', 'e me']"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "letter.split(\"v\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "id": "143ccd90",
   "metadata": {},
   "outputs": [],
   "source": [
    "##列表\n",
    "words = [ \"hello\",\"world\" ]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "id": "d49eb439",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 使用列表\n",
    "vowels = ['a','e','i','0','u']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "id": "2f35608d",
   "metadata": {},
   "outputs": [],
   "source": [
    "word = \"milliways\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "id": "3bab7acf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "i\n",
      "i\n",
      "a\n"
     ]
    }
   ],
   "source": [
    "for letter in word: \n",
    "    if letter in vowels:\n",
    "        print(letter)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "cc5fbd06",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "##扩展列表\n",
    "found = []\n",
    "len(found)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b0b69961",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
